package com.zbkj.crmeb.order.pprocess;

import com.zbkj.crmeb.chant.request.PurchaseProductRequest;
import com.zbkj.crmeb.finance.model.UserRecharge;
import com.zbkj.crmeb.front.request.OrderCreateRequest;
import com.zbkj.crmeb.front.response.OrderPayItemResponse;
import com.zbkj.crmeb.front.response.OrderPayResponse;
import com.zbkj.crmeb.merchant.api.request.BuyMemberRequest;
import com.zbkj.crmeb.store.model.StoreOrder;
import com.zbkj.crmeb.store.model.StoreOrderInfo;
import com.zbkj.crmeb.store.request.StoreOrderRefundRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 线下支付方式
 */
@Service("offlineOrderProcess")
public class OfflineOrderProcess extends AbstractOrangePayOrderProcess {

    public static final Logger logger = LoggerFactory.getLogger(OfflineOrderProcess.class);

    @Override
    public OrderPayResponse creatPayOrder(String key, OrderCreateRequest orderRequest, String ip) {
        StoreOrder storeOrder = super.createOrder(key,orderRequest,ip);
        return new OrderPayResponse("SUCCESS", new OrderPayItemResponse(key, storeOrder.getOrderId()));
    }

    @Override
    public HashMap<String, Object> toPayOrder(StoreOrder order, String ip) {
        HashMap<String, Object> resultMap = new HashMap<>();
        resultMap.put("result", "请等待商家确认");
        resultMap.put("status","offline");
        return resultMap;
    }

    @Override
    public boolean refund(StoreOrderRefundRequest request,StoreOrder storeOrder, StoreOrderInfo storeOrderInfo) {
        return goOnRefund(request,storeOrder,storeOrderInfo);
    }

    @Override
    public UserRecharge createImgRecharge(BigDecimal price) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public Object buyMember(BuyMemberRequest request) {
        return null;
    }

    @Override
    public Map<String, Object> purchaseProduct(PurchaseProductRequest purchaseProductRequest, String ip) {
        return null;
    }
}
